1 package cz
.brmlab
.brmtron
.server
.test
;
3 import static org
.junit
.Assert
.*;
7 import cz
.brmlab
.brmtron
.server
.Player
;
8 import cz
.brmlab
.brmtron
.server
.ProtocolHelper
;
10 public class ProtocolHelperTest
{
13 public void test_parsePlayer(){
15 String input
= "1 --- tester --- 1.1123 --- 54.4234 --- true\n";
17 p
= ProtocolHelper
.parsePlayer(input
);
19 assertTrue(p
.getId() == 1);
20 assertTrue(p
.getName().equals("tester"));
21 assertTrue(p
.getLongitude() == 1.1123);
22 assertTrue(p
.getLatitude() == 54.4234);
23 assertTrue(p
.isActive());
27 public void test_buildPlayer() {
28 String inp
= "1 --- tester --- 1.1123 --- 54.4234 --- true\n";
29 Player p
= ProtocolHelper
.parsePlayer(inp
);
30 String s
= ProtocolHelper
.buildPlayer(p
);
31 assertTrue(s
.equals(inp
));